<div id="hp_intro"><%= @page_title %></div>

<% form_for(:user, :url => {:action => "update" }) do |f| %>	
<%= f.error_messages %>

<table border="0" cellspacing="0" cellpadding="0">
	
	<tr><td valign="top">

	<h2><%= t('settings.required')%></h2>
	<p>
	<div class="field">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr><td valign="top">
				<div class="field_label">
					<%= t('settings.edit.first_name.label')%>
				</div>
				<div class="field_box">
		    		<%= f.text_field :first_name, :size => 12 %> 
				</div>
			</td><td valign="top" style="padding-left: 3px;">
				<div class="field_label">
					<%= t('settings.edit.last_name.label')%>
				</div>
				<div class="field_box">
		    		<%= f.text_field :last_name, :size => 15 %>
				</div>
			</td>
			</tr>
		</table>
		<div class="small"><%= t('settings.edit.first_name.example')%></div>
	</div>
	
	<div class="field">
		<div class="field_label">
			<%= t('settings.edit.email.label')%>
		</div>
		<div class="field_box">
    		<%= f.text_field :email %>
		</div>
		<div class="small"><%= t('settings.edit.email.example')%></div>
	</div>

	<div class="field">
	<div class="field_label">
		<%= t('settings.edit.login.label')%>
	</div>
	<div class="field_box">
		<%= f.text_field :login, :maxlength => 40, :size => 30 %>
	</div>
	<div class="small"><%= t('settings.edit.login.example')%></div>
	</div>
	
	<% if current_government.is_branches? %>
	<div class="field">
	<div class="field_label">
		<%= t('settings.edit.branch.label')%>
	</div>
	<div class="field_box">
		<%= f.select :branch_id, current_branches.collect{|t|[t.name, t.id]}, :include_blank => true %>
	</div>
	</div>	
	<% end %>
	
	<div class="field">
		<div class="field_box">
			<%= f.check_box :is_mergeable %> <%= t('settings.edit.is_mergeable.label')%>
		</div>
		<div class="field_box">
			<%= f.check_box :is_newsletter_subscribed %> <%= t('settings.edit.is_newsletter_subscribed.label')%>
		</div>
	</div>	

</td><td valign="top" width="300" style="padding-left: 20px;">
	
	<h2><%= t('settings.optional')%></h2>
	
	<div class="field">
		<div class="field_label">
			<%= t('settings.edit.zip.label')%>
		</div>
		<div class="field_box">
    		<%= f.text_field :zip %>
		</div>
	</div>

	<div class="field">
		<div class="field_label">
			<%= t('settings.edit.website.label')%>
		</div>
		<div class="field_box">
    		<%= f.text_field :website %>
		</div>
	</div>

	<div class="field">
		<div class="field_label">
			<%= t('settings.edit.birth_date.label')%>
		</div>
		<div class="field_box">
    		<%= f.date_select :birth_date, :include_blank => true, :start_year => 1908, :end_year => 1996,  :order => [:month, :day, :year] %>
		</div>
	</div>
	
	<% if (current_government.has_facebook_enabled? and not facebook_session) or (current_government.has_twitter_enabled? and not current_user.has_twitter?) %>
		<h2><%= t('settings.connect')%></h2>
	
		<%= t('settings.connect_intro')%>
		<p>
		<% if current_government.has_facebook_enabled? and not facebook_session %>
			<%= fb_login_and_redirect url_for, :size => :medium, :background => :white, :length => :long %>
		<% end %>
	
		<% if current_government.has_twitter_enabled? and not current_user.has_twitter? %>
			<p><%= link_to image_tag("twitter_signin.png", :border => 0), :controller => "twitter", :action => "create" %>
		<% end %>
	<% end %>
	</td>
</tr>
</table>

<%= f.submit t('settings.edit.submit'), :class => "yellow_button" %></p>
<% end -%>
	
<p>
<br/>
<%= link_to t('settings.delete.name'), delete_settings_url %>